<?php namespace app\home\controller;

class Content extends Common{
    //动作
    public function index($aid){
    //此处书写代码...
        //显示具体的文章
        $data=Db::table('article')
            ->join('category','article.cid','=','category.cid')
            ->field(['article.title','article.cid','article.content','article.aid','article.author','article.pubtime','category.cname','article.thumb','article.digest'])
            ->where('article.aid',$aid)
            ->first();
            $data[tags]=Db::table('article')
                ->join('article_tag','article.aid','=','article_tag.aid')
                ->field(['tag.tid','tag.tname'])
                ->join('tag','tag.tid','=','article_tag.tid')
                ->where('article_tag.aid',$data['aid'])
                ->get();
//                p($data);
        View::with('data',$data);
        return view();
    }
}
